<div class="crumb-wrap">
    <div class="crumb-list"> <i class="icon-font"></i>
        <a href="<?=site_url()?>">首页</a>
        <span class="crumb-step">&gt;</span>
        <a class="crumb-name" href="<?=site_url('order/index')?>">订单管理</a>
        <span class="crumb-step">&gt;</span>
        <span>用户订单</span>
    </div>
</div>
<style type="text/css">
    .show_table th{
        text-align: center;
    }
</style>
<div class="result-wrap">
    <form action="/think/admin/system/save" method="post" id="myform" name="myform">
        <div class="config-items">
            <div class="config-title">
                <h1>
                    <i class="icon-font">&#xe014;</i>
                    用户信息
                </h1>
            </div>
            <div class="result-content">
                <table class="insert-tab show_table" width="90%">
                    <tr style="background: #f5f5f5">
                        <th width="150">用户ID</th>
                        <th>真实姓名</th>
                        <th>联系手机</th>
                        <th>联系QQ</th>
                        <th>联系微信</th>
                        <th>邮箱</th>
                    </tr>
                    <tr>
                        <th><?=$uinfo['id']?></th>
                        <th><?=$uinfo['name']?></th>
                        <th><?=$uinfo['phone']?></th>
                        <th><?=$uinfo['qq']?></th>
                        <th><?=$uinfo['weixin']?></th>
                        <th><?=$uinfo['email']?></th>
                    </tr>
                </table>
                <table width="90%" class="insert-tab" style="margin-top: 10px">
                    <tr>
                        <th width="150">单位名称：</th>
                        <td><?= !$uinfo['company'] ? '(空)' : $uinfo['company']?></td>
                    </tr>
                    <tr>
                        <th width="150">联系地址：</th>
                        <td><?= !$uinfo['address'] ? '(空)' : $uinfo['address']?></td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="config-items">
            <div class="config-title">
                <h1>
                    <i class="icon-font">&#xe00a;</i>
                    用户订单信息
                </h1>
            </div>
            <div class="result-content">
                <table class="insert-tab show_table" width="90%">
                    <tr style="background: #f5f5f5">
                        <th width="150">订单编号</th>
                        <th>订单状态</th>
                        <th>订单积分</th>
                        <th>创建时间</th>
                        <th>更新时间</th>
                    </tr>
                    <tr>
                        <th><?=$res['id']?></th>
                        <th style="color:red"><?=$status[$res['status']]?></th>
                        <th><?=$res_par['price']?></th>
                        <th><?=date('Y-m-d H:i:s',$res['create_time'])?></th>
                        <th><?=date('Y-m-d H:i:s',$res['update_time'])?></th>
                    </tr>
                </table>
                <table width="90%" class="insert-tab" style="margin-top: 10px">
                    <tr>
                        <th width="150">订单项目</th>
                        <td><?=$res_par['title']?>&nbsp;&nbsp;<a href="<?=site_url('parameters/show?pid='.$res_par['id'])?>" target="_blank">查看项目信息</a></td>
                    </tr>
                    <tr>
                        <th width="150">联系姓名</th>
                        <td><?=$res['user_name']?></td>
                    </tr>
                    <tr>
                        <th width="150">联系电话</th>
                        <td><?=$res['user_phone']?></td>
                    </tr>
                    <tr>
                        <th>系统备注</th>
                        <td><?=$res['remarks']?></td>
                    </tr>
                    <tr>
                        <th>用户备注</th>
                        <td><pre><?=$res['user_remarks']?></pre></td>
                    </tr>
                    <?php if($res['status'] == 6): ?>
                    <tr>
                        <th>积分退还备注</th>
                        <td style="color:red"><pre><?=$res['mess']?></pre></td>
                    </tr>
                    <?php endif;?>
                </table>
            </div>
            <div class="result-content" style="margin-top: 15px">
                <?php if($res['status'] == 4): ?>
                <a href="javascript:;" onclick="signing()" class="btn btn6 mr10 btn-primary">订单签收</a>
                <?php endif;?>
                <?php if($res['status'] == 1): ?>
                <a href="<?=site_url('order/update?oid='.$res['id'])?>" class="btn btn6 mr10 btn-primary">付款</a>
                <?php endif;?>

                <a href="javascript:;" onclick="history.go(-1)" class="btn btn6 mr10">返回</a>
            </div>
        </div>

    </form>
</div>
<script type="text/javascript">

    //订单处理
    function signing(){
        layer.confirm("该操作不能取消，是否确认签收项目？", {
            icon:0,
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post("<?=site_url('order/signing')?>",{oid:<?=$res['id']?>},function(data){
                if(data == 1){
                    layer.alert("操作成功！",{
                        icon:1,
                    },function(){
                        location.reload();
                    });
                }else{
                    layer.alert(data,{
                        icon:2,
                    });
                }
            });
        });
    }

    function open_view(url){
        layer.open({
            type: 2,
            area: ['800px', '600px'],
            fix: false, //不固定
            maxmin: true,
            content: url
        });
    }
</script>